Repository navigation
recovery: enforce battery and thermal cutoffs after the app exits - #114
Draft
sreyassabbani wants to merge 5 commits into
Draft
sreyassabbani wants to merge 5 commits into
sreyassabbani wants to merge 5 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Depends on #113. This draft targets main because the thermal branch lives in a fork; its diff includes both safety changes. The recovery-only diff is sreyassabbani/Insomnia@fix/closed-lid-thermal-cutoff...fix/backstop-safety-checks . Integrate #113 first.
The recovery agent currently honors a future deadline even after the GUI exits, so battery and thermal cutoff rules stop being enforced after a crash. New sessions opt into a versioned, read-only
Insomnia --check-safety 5mode that exits before AppKit starts and uses the same end rules as the app. The existing per-minute agent requires that protocol before calling it; a cutoff, unavailable helper, timeout or unexpected output triggers owned recovery. Legacy session files retain deadline-only behavior.Arm the helper's lifetime before any read, preserve the recovery lock, and validate an exact one-line response with exit status zero. Expire the saved deadline before undo so failed restoration is retried after cooling. The GUI synchronizes every 30 seconds and before Extend; Extend and relaunch cannot revive a cutoff. No sudoers permissions are added.
Validation at the synced head
Head:
b5d0afeaf2842bdbe9edd2eac390693dd547d45f, incorporating upstreame242782584451a4fa4479bbd8f5a5e149d2f254cand thermal branch headaf42be5f8a4e92f49080d22b3eb5d6e8b905141d.git diff --checkpassed.Inspired by Adrafinil's independent monitor and latched cutoff pattern; no code copied. macOS thermal pressure and polling cannot establish safe operation in a backpack.
Real-Mac evidence
Not run for this head: installed-app, crash, relaunch, supervised closed-lid and other affected checks in
docs/releasing.md. Earlier October 13 combined-stack installation and partial physical observations refer to the prior head. They do not satisfy the head-specific installed-app report required by CONTRIBUTING.md.The
.greptile/rules.mdchange documents the recovery protocol and still requires the owner's config approval. This remains a draft subject to acceptance, reviews, CI and hardware evidence.